package com.nineclock.system.feign;

import com.nineclock.common.entity.PageResult;
import com.nineclock.common.entity.Result;
import com.nineclock.sign.dto.SignDTO;
import com.nineclock.system.dto.SysCompanyUserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author 黑马程序员
 * @Company http://www.ithiema.com
 * @Version 1.0
 */
@FeignClient("sys-service")
public interface OrganizationFeign {

    @GetMapping("/organization/department/top")
    public Result<List<Long>> queryDepartmentIds();

    @GetMapping("/organization/department/membernum")
    public Result<Integer> queryUserCountByDepartmentIds(
            @RequestParam("departmentIds") List<Long> departmentIds);


    @GetMapping("/department/allDepId/{companyUserId}")
    public Result<List<Long>> queryDepartmentsByUserId(@RequestParam("companyUserId") Long companyUserId);

    @GetMapping("/organization/members/simple")
    public Result<List<SysCompanyUserDTO>> queryAllCompanyUser();

    @GetMapping("/organization/membersCompanyUser")
    public Result<PageResult<SysCompanyUserDTO>> membersUser(@RequestParam(value = "page",defaultValue = "1") Integer page,
                                                             @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize);

    //获取部门下员工编号集合
    @GetMapping("/companyUser/query/companyUserIds")
    public Result<List<Long>> queryUserIdByDepartmentIds(@RequestParam("departIds")List<Long> departIds);

}
